package samsung.sds.systemMonitor.SQLMonitor.intercept;


public class SQLMoniterHandlerFactory {
	
	public static SQLMonitorHandler getInstance(String interceptorType) throws Throwable {
		if(interceptorType.equals("debug")){
			return new DebugSQLMonitor();
		}else if(interceptorType.equals("error")){
			return new ErrorSQLMonitor();
			
	    	//custom类型为C/R/U/D，interceptorType分别为(C-custom/R-custom/U-custom/D-custom/)
		}else if((interceptorType.endsWith("custom")&&
				((interceptorType.split("-")[0]).contains("C")||(interceptorType.split("-")[0]).contains("R")||
						(interceptorType.split("-")[0]).contains("U")||(interceptorType.split("-")[0]).contains("D")))){
			return new CustomSQLMonitor();
		}else{
			return new CloseSQLMonitor();
		}
	}
}